import request from '../config/indexNew'

// 获取第三方群发事件
export const getMassDispatchList = (data: any) => {
  return request({
    url: '/api/win-tool/mass-dispatch/list',
    method: 'POST',
    data
  })
}

// 获取任务基本信息
export const massDispatchBaseInfo = (data: any) => {
  return request({
    url: '/api/win-tool/mass-dispatch/base-info',
    method: 'GET',
    params: data
  })
}

// 数据统计
export const massDispatchStatistics = (data: any) => {
  return request({
    url: '/api/win-tool/mass-dispatch/statistics',
    method: 'POST',
    data
  })
}

// 获取消息预览
export const massDispatchPreview = (data: any) => {
  return request({
    url: '/api/win-tool/mass-dispatch/preview',
    method: 'GET',
    params: data
  })
}

// 获取消息详情
export const massDispatchDetail = (data: any) => {
  return request({
    url: '/api/win-tool/mass-dispatch/detail',
    method: 'POST',
    data
  })
}

// 获取高级设置
export const advancedShow = (data: any) => {
  return request({
    url: '/api/win-tool/advanced/show',
    method: 'POST',
    data
  })
}

// 保存高级设置
export const advancedSet = (data: any) => {
  return request({
    url: '/api/win-tool/advanced/set',
    method: 'POST',
    data
  })
}

// 
export const setToggle = (data: any) => {
  return request({
    url: '/api/win-tool/advanced/toggle',
    method: 'POST',
    data
  })
}

// 事件群发
export const massDispatchSend = (data: any) => {
  return request({
    url: '/api/win-tool/mass-dispatch/send',
    method: 'POST',
    data
  })
}

// 私信群发
export const massDispatchDetailSend = (data: any) => {
  return request({
    url: '/api/win-tool/mass-dispatch/detailSend',
    method: 'POST',
    data
  })
}

// 客户匹配
export const toMatchCustwxWork = async (data) => {
  return await request.post('/api/common/wx-work/match-local-user', data)
}
// 客户群匹配
export const toMatchCustGroupwxWork = async (data) => {
  return await request.post('/api/common/wx-work/match-local-group', data)
}
// 提交客户匹配信息接口
export const toSubmitMatchCustInfo = async (data) => {
  return await request.post('/api/win-tool/mass-dispatch/bind-relation', data)
}